1. Field of the Invention
Embodiments of the present invention generally relate to decompression of texture data that is compressed using a fixed block compression technique and, more specifically, to decompression of a 4×4 block of texture data compressed into a conventional block compression format.
2. Description of the Related Art
Conventional compression techniques and formats, such as a DXTC compressed texture format used by Microsoft's DirectX API, e.g., DXT1, DXT2, DXT3, DXT4, DXT5, BC4, and BC5, may be used to compress unsigned or signed data for a 4×4 block of texture data including 3 components represented by a 16 bit value, such as 565 format RGB (red, green, blue) data. Some block compression formats also include alpha, for example storing 16 4 bit alpha values or 2 8 bit alpha values and 16 3 bit indices (one index for each texel) along with the compressed color components for a 4×4 block.
FIG. 1A illustrates a prior art fixed size, 4×4, block 100 of 16 texels that is compressed using a conventional block compression technique. Each texel within block 100 may include one or more components, e.g., red, green, blue, alpha, or the like. Each component is compressed separately to reduce any cross-component interactions. Blocks of texture data, e.g., color or alpha, within a texture map may be compressed to a specific DXTC format.
FIG. 1B illustrates prior art data fields of a conventional DXTC compression format representing a block 100. A single component of 16 bit texel data for block 100 is 256 bits in size. The compression ratios for DXTC compressed texture data range from 4:1 to 8:1, depending on the format used. The DXTC compression formats include 64 bits of data (8 bytes) representing a compressed component of block 100. Some of the compression formats include two 16 bit values, Color0 and Color1, and 16 2 bit indices, one index for each texel. Each index is referenced as iyx, where x and y correspond to the x,y position of the texel within block 100. For example, index i01 corresponds to y=0 and x=1. Color0 and color1 may each represent a 16 bit value, such as 565 RGB data and each index corresponds to one texel in block 100, and specify how combine color0 and color1 to produce the texture data corresponding to each texel in block 100.
Because DXTC compression is lossy, a certain amount of error is tolerated, and the maximum tolerable error is specified by the standard. Decompressing the texture data with a minimum error may require complex computations that are not well-suited to a hardware implementation.
Accordingly, there is a need for decompression of texture data that simplifies the computations needed to produce the decompressed texture data while remaining within the error tolerance specified by the decompression standard. Simplifying the computations allows for the texture data decompression throughput to be increased when compared with decompressing using more accuracy and more complex computations. Furthermore, it is desirable to decompress multiple DXTC compressed texture formats using a multipurpose decompression unit to produce the texture data given a variety of formats rather than using dedicated decompression units that are specific to each DXTC format.